//
//  JKKeyChainUUID.m
//  JKOCGitKeyChainUUID
//
//  Created by 王冲 on 2018/2/12.
//  Copyright © 2018年 希爱欧科技有限公司. All rights reserved.
//

#import "JKKeyChainUUID.h"
#import <UIKit/UIKit.h>
#import "SAMKeychain.h"
@implementation JKKeyChainUUID

#pragma JKkeychain
+(NSString *)jkGetDeviceId
{
    NSString * currentDeviceUUIDStr = [SAMKeychain passwordForService:@"CIO"account:@"CIOapp"];
    if (currentDeviceUUIDStr == nil || [currentDeviceUUIDStr isEqualToString:@""])
    {
        NSUUID *currentDeviceUUID  = [UIDevice currentDevice].identifierForVendor;
        currentDeviceUUIDStr = currentDeviceUUID.UUIDString;
        currentDeviceUUIDStr = [currentDeviceUUIDStr stringByReplacingOccurrencesOfString:@"-" withString:@""];
        currentDeviceUUIDStr = [currentDeviceUUIDStr lowercaseString];
        [SAMKeychain setPassword: currentDeviceUUIDStr forService:@"CIO"account:@"CIOapp"];
    }
    return currentDeviceUUIDStr;
}


@end
